#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>

int main()
{
  pid_t pid;
  int i;
  for(i = 0;i < 5;i++)
  {
    pid = fork();
    if(pid == 0)
    {
      printf("my pid is %d\n",getpid());
      return 0;
    }
  }

  while(wait(NULL)!= -1);
  printf("I am father,my pid is %d\n",getpid());
  return 0;
}
